<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>发布项目</title>
    <link href="css/public.css" rel="stylesheet"/>
    <link href="css/view.css" rel="stylesheet"/>
    <link href="css/tipbox.css" rel="stylesheet" type="text/css"/>
    <!--foot-->
    <link href="css/public_1.css" rel="stylesheet" media="all"/>
    <style></style>
    <script src="js/vue2.5.17.js"></script>
    <script src="js/kindeditor-all.js"></script>
    <script src="js/lang/zh-CN.js"></script>
    <script type="text/javascript" src="js/jquery1.7.js"></script>
    <script src="../admin/layui/layui.all.js"></script>
    <link rel="stylesheet" href="../admin/layui/css/layui.css">
</head>
<body>


<div class="header_bg">
    <div class="header wap">
        <div class="logo"><a href="/index.html" title="权名众筹系统">权名众筹系统</a></div>
        <div class="nav cfff">
            <ul>
                <li class="nav_a1"><a href="/index.html">首页</a></li>
                <li class="nav_a2"><a href="/home/list.html?projectName=&page=1&limit=10&type=0">全部项目</a></li>
                <li class="nav_a4"><a href="/home/apply.html">发布项目</a></li>                 <li class="nav_a5"><a href="/admin/index.html#/user/login">后台管理</a></li>


            </ul>
        </div>
        <div class="h_right" id="h_right_userInfo">
            <ul class="h_login h_user displayNone"
                v-bind:class="[userInfo.code===101 ? 'displayInlineBlock':'displayNone']" id="login_panel">
                <span>
                            <li class="hl_login"><a href="/home/login.html" class="h_login_ring">登录</a></li>
                            <li class="hl_reg"><a href="/home/sign.html" class="h_login_join">注册</a></li>
                            <li class="qq_login"><a href="#" title="QQ登陆">QQ登录</a></li>
                </span>
                <li class="help_login"><a href="#">帮助</a></li>
            </ul>
            <ul class="h_login  h_reg displayNone"
                v-bind:class="[userInfo.code===0 ? 'displayInlineBlock':'displayNone']" id="login_info">
                <div>
                    <li class="h_name"><a href="/home/user/user.html">{{userInfo.data!=null ?userInfo.data.username:''}}</a>
                        <div class="popup name_popup cfff displayNone">
                            <a href="/home/user/user.html">我的帐户</a>
                            <a href="/home/logout">安全退出</a>
                        </div>
                    </li>
<!--<li class="h_message"><a href="#" id="notify">提醒</a>-->                         <!--<div class="popup message_popup cfff displayNone">-->                             <!--<a href="#" id="unread">未读通知 </a>-->                             <!--<a href="#" id="unreview">待评价项目 </a>-->                             <!--<a href="#" id="uncash">未兑现项目 </a>-->                         <!--</div>-->                     <!--</li>-->

                    <li class="help_login"><a href="#">帮助</a></li>
                </div>
            </ul>
        </div>
        <div class="top_nav_ti" style="display: none;" id="tips_help">
            <span class="arrow"></span>
            <p>初来乍到？先看看帮助吧！</p>
            <a href="#" class="view_btn" id="close_help">知道啦</a>
        </div>
    </div>
</div>


<div class="content wap content_about">


    <div class="bread_crumbs">
        <a href="/index.html">首页</a>
        >{{projectInfo.data.projectType.typeName}}>{{projectInfo.data.name}}
    </div>
    <div class="pro_main">



    </div>
    <div class="pro_right">
        <div class="pro_tit">
            <h1 class="f_yahei">{{projectInfo.data.name}}</h1>
            <div class="pro_view f14">
                {{projectInfo.data.description}}
            </div>
        </div>
        <div class="pro_author">
            <div class="box_tit">
                <h2 class="box_tit_author"><b></b><strong>当前用户</strong></h2>
            </div>
            <ul class="pro_author_list">
                <li>
                    <a href="#" target="_blank">
                        <img :src="projectInfo.data.homeUser.userImg" width="50" height="50" :alt="projectInfo.data.homeUser.username"/>
                        {{projectInfo.data.homeUser.username}}
                    </a>
                </li>
            </ul>
        </div>
        <div class="pro_state">
            <div class="state_time">
                已筹集到
                <strong class="f_yahei"><em>￥</em>35,200</strong>
                <span>此项目必须在&nbsp;<em>2013年09月08日</em>&nbsp;前得到&nbsp;<em>￥8,800</em>&nbsp;的支持才可成功！</span>
            </div>
            <div class="state_plan_bg">
                <div class="state_plan" style="width:100%"></div>
                <div class="state_plan_txt">已达：400%</div>
            </div>
            <ul class="pro_note f_yahei">
                <li class="first"><span><strong>{{projectInfo.data.day}}</strong>剩余天数</span></li>
                <li><span><strong>354</strong>支持者</span></li>
            </ul>

            <div class="state_big state_big_end">
                <strong>已结束</strong><b></b>
            </div>

        </div>
        <div class="pro_list">
            <div class="pro_price f_yahei c_wap"><span class="lt">支持￥88.00</span><span class="rt zc_sum">已售出<em>400</em>张</span>
            </div>
            <dl class="pro_list_gain">
                <dt>将会获得：</dt>
                <dd v-html="projectInfo.data.commodityDescription"></dd>
            </dl>
            <div class="pro_action" type="5">
                <input type="hidden" class="price" value="88.00">
                <div class="pro_price_num"><em>支持数量：</em><select name="num" class="num">
                    <option value="1">1</option>
                </select></div>
                <div class="pro_price_num"><em>支持价格：</em><strong class="pro_note_num f_yahei"
                                                                 class="total">￥88.00</strong></div>
                <div class="pro_price_btn pro_price_btn_end"><a href="#" class="f_yahei">已结束</a></div>
            </div>
        </div>


        <div class="pro_rating">
            <div class="box_tit">
                <h2 class="box_tit_rating"><b></b><strong>我要评价</strong></h2>
            </div>
            <div class="pro_rating_result">
                <em>综合评分：</em>
                <span class="pro_rating_total" id="score_avg">0</span>
                <div class="evaluate_score"><span class="info_stars" style="width:0px" id="star_width"></span></div>
            </div>
            <div id="score_list">
            </div>
        </div>
        <div class="pro_ask">
            <div class="box_tit">
                <h2 class="box_tit_ask"><b></b><strong>项目咨询</strong></h2>
            </div>
            <div class="ask_post">
                <div class="ask_publish" style="display:inline-block;" id="ask">
                    <textarea class="ask_text" cols="45" rows="5" id="content_ask" name="content_ask"></textarea>
                    <span class="ask_tips">请输入你要提问的内容...</span>
                    <p class="ask_publish_action"><input class="pro_ask_btn btn" type="button" name="doit" id="doit"
                                                         value="提交问题"></p>
                </div>
                <div class="ask_publish ask_publish_un" id="ask_login" style="display:none;">
                    <div class="ask_publish_un_tips" style="display:inline-block;">请先&nbsp;&nbsp;<a href="javascript:;" id="qlogin">登录</a>&nbsp;|&nbsp;<a
                            href="http://www.baidu.com/reg?refUrl=http://www.baidu.com/zc/" id="qreg">注册</a></div>
                    <div class="ask_publish_action"><input class="pro_ask_btn btn" type="button" name="" value="提交问题">
                    </div>
                </div>
            </div>
            <h3 class="pro_ask_tit">问题列表</h3>
            <div id="faq_list"></div>
        </div>
    </div>


</div>

<div class="footer">
    <div class="ft_link_bg">
        <div class="ft_link">

            <dl class="ft_coop">
                <dt>合作伙伴</dt>
                <dd>


                </dd>
            </dl>
            <dl class="ft_help">
                <dt>帮助拓展</dt>

            </dl>
        </div>
    </div>
</div>

<div class="ws_global_footer">
    <div class="ws_footer_info" style="min-width: 1000px">
        <div class="content">
            <p>
                <a href="#" target="_blank">桂ICP备123456789</a>　
                权名众筹　
                权名众筹　
                权名众筹　
                <a href="#"
                   target="_blank"
                   style="width:16px;height:16px;display:inline-block;background:url('images/wen_icon.png')">&nbsp;</a>
            </p>
            <p>
                Copyright (C) 2018 权名众筹 Rights Reserved　
                 　
                　
                <a href="#" target="_blank">百度</a>
            </p>
        </div>
    </div>
</div>





<script>
    //获取头部
    $.ajax({
        url: "/home/getCurrentUser",
        async: true,
        success: function (data) {
            if (data.code==101){
                alert("请先登录");
                window.location.href="/home/login.html";
            }
            new Vue({
                el: '#h_right_userInfo',
                data: {userInfo: data}
            })
            console.log(data)
        }
    });



    //    获当项的具体信息

    // alert();

    /*    $.ajax({
            url: "/home/getProjectById",
            async: true,
            data: {'id': GetQueryString("id")},
            success: function (data) {
                new Vue({
                    el: '.content',
                    data: {projectInfo: data}
                })
                console.log(data)
            }
        });*/

</script>


<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate
            ,$ = layui.$
            ,upload = layui.upload
        ;



        //普通图片上传
        var uploadInst = upload.render({
            elem: '#LAY_avatarUpload'
            ,url: '/api/upload/'
            ,done: function(res){
                //如果上传失败
                if(res.code > 0){
                    return layer.msg('上传失败');
                }
                //上传成功
                $("#LAY_avatarSrc").val(res.src);

            }
        });


        //查看Banner
        $(document).on('click','#show_banner',function(){
            // layer.msg('hello');
            var json={
                "title": "", //相册标题
                "id": 123, //相册id
                "start": 0, //初始显示的图片序号，默认0
                "data": [   //相册包含的图片，数组格式
                    {
                        "alt": "图片名",
                        "pid": 666, //图片id
                        "src": $("#LAY_avatarSrc").val(), //原图地址
                        "thumb": "" //缩略图地址
                    }
                ]
            }
            layer.photos({
                photos: json
                ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
            });
            return false;
        });


        form.render();
        //日期
        laydate.render({
            elem: '#date1'
            ,type: 'datetime'
        });

        laydate.render({
            elem: '#date2'
            ,type: 'datetime'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //监听提交
        form.on('submit(demo1)', function (data) {
            console.log(data.field);
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            });
            $.ajax({
                url: "/home/addProject",
                data:data.field,
                type:'POST',
                success: function (d) {
                    console.log(d)
                }
            });

            return false;
        });

        //表单初始赋值
        /*        form.val('example', {
                    "username": "贤心" // "name": "value"
                    , "password": "123456"
                    , "interest": 1
                    , "like[write]": true //复选框选中状态
                    , "close": true //开关状态
                    , "sex": "女"
                    , "desc": "我爱 layui"
                })*/


    });
</script>


</body>
</html>
